﻿using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace Negocio
{
   public class ClinicalHistory: PersistentObject
    {
        private Player player;
        private ObservableCollection<Disease> diseases;
        private ObservableCollection<Injury> injuries;


        public ClinicalHistory()
        {
            this.Player = new Player();
            this.Diseases = new ObservableCollection<Disease>();
            this.Injuries = new ObservableCollection<Injury>();
        }

        public Player Player 
        {
            get { return this.player; }
            set { this.player = value;}
        }

        public ObservableCollection<Disease> Diseases 
        {
            get { return this.diseases; }
            set { this.diseases = value; }
        }

        public ObservableCollection<Injury> Injuries 
        {
            get { return this.injuries; }
            set { this.injuries = value; }
        }

        public bool addDisease(Disease oneDisease)
        {
            bool ret = false;
            if (!this.diseases.Contains(oneDisease)) 
            {
                this.diseases.Add(oneDisease);
                ret = true;
            }
            return ret;
        }

        public void deleteDisease(Disease oneDisease)
        {
            this.diseases.Remove(oneDisease);
        }

        public bool addInjury(Injury oneInjury)
        {
            bool ret = false;
            if (!this.Injuries.Contains(oneInjury))
            {
                this.Injuries.Add(oneInjury);
                ret = true;
            }
            return ret;
        }

        public void deleteInjury(Injury oneInjury)
        {
            this.Injuries.Remove(oneInjury);
        }

        
        public override bool Equals(object obj)
        {
            return this.Player.Equals(((ClinicalHistory)obj).Player);    
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

    }
}
